package com.dianrui.moonfire.util;

import android.text.TextUtils;
import android.view.Gravity;
import android.widget.Toast;



public class ToastUtil {
    private static Toast MyToast;
    private static final String SYN = "syn";

    public static void showToast(String msg) {
        if (TextUtils.isEmpty(msg)) {
            return;
        }
        synchronized (SYN) {
            if (MyToast == null) {
                MyToast = Toast.makeText(Static.CONTEXT, "", Toast.LENGTH_SHORT);
                MyToast.setGravity(Gravity.CENTER, 0, 0);
            }
            if (!StringUtils.isEmpty(msg)){
                MyToast.setText(msg);
                MyToast.show();
            }
        }
    }
}

